package p270jp.pxv.android.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.BackStackRecord;
import java.util.Locale;
import p014ae.Hilt_IllustSeriesDetailActivity;
import p047bg.C1124a;
import p090d0.C2518n;
import p134ei.AnalyticsScreenName;
import p270jp.pxv.android.R;
import p270jp.pxv.android.legacy.model.PixivUser;
import p270jp.pxv.android.model.PixivIllustSeriesDetail;
import p314lg.ActivityIllustSeriesDetailBinding;
import p325m0.MutabilityOwnership;
import p547uh.IllustSeriesDetailFragment;
import p603wm.AbstractC6949c;
import p677zi.PixivImageLoader;

/* renamed from: jp.pxv.android.activity.IllustSeriesDetailActivity */
/* loaded from: classes2.dex */
public class IllustSeriesDetailActivity extends Hilt_IllustSeriesDetailActivity {

    /* renamed from: e0 */
    public static final /* synthetic */ int f18378e0;

    /* renamed from: b0 */
    public ActivityIllustSeriesDetailBinding f18379b0;

    /* renamed from: c0 */
    public PixivIllustSeriesDetail f18380c0;

    /* renamed from: d0 */
    public final AbstractC6949c<PixivImageLoader> f18381d0 = C2518n.m7638h(PixivImageLoader.class);

    /* renamed from: e1 */
    public static Intent m4817e1(Context context, long j) {
        Intent intent = new Intent(context, IllustSeriesDetailActivity.class);
        intent.putExtra("ILLUST_SERIES_ID", j);
        return intent;
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.f18379b0 = (ActivityIllustSeriesDetailBinding) DataBindingUtil.m11369d(this, R.layout.activity_illust_series_detail);
        this.f18757A.m6525e(AnalyticsScreenName.ILLUST_SERIES_DETAIL);
        C1124a.m10196R(this, this.f18379b0.f21970t, "");
        long longExtra = getIntent().getLongExtra("ILLUST_SERIES_ID", 0);
        BackStackRecord cVar = new BackStackRecord(m11131K0());
        IllustSeriesDetailFragment l4Var = new IllustSeriesDetailFragment();
        Bundle bundle2 = new Bundle();
        bundle2.putLong("ILLUST_SERIES_ID", longExtra);
        l4Var.setArguments(bundle2);
        cVar.m11165j(R.id.list_container, l4Var);
        cVar.mo11171d();
    }

    @Override // androidx.activity.ComponentActivity, android.app.Activity
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_illust_series_detail, menu);
        return true;
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, androidx.activity.ComponentActivity, android.app.Activity
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        PixivIllustSeriesDetail pixivIllustSeriesDetail;
        if (menuItem.getItemId() != R.id.menu_share || (pixivIllustSeriesDetail = this.f18380c0) == null) {
            return super.onOptionsItemSelected(menuItem);
        }
        Locale locale = Locale.US;
        PixivUser pixivUser = pixivIllustSeriesDetail.user;
        String format = String.format(locale, "%s | %s #pixiv https://www.pixiv.net/user/%d/series/%d", pixivIllustSeriesDetail.title, pixivUser.name, Long.valueOf(pixivUser.f19078id), Long.valueOf(this.f18380c0.f19131id));
        MutabilityOwnership.m3745m(format, "shareText");
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setType("text/plain");
        intent.putExtra("android.intent.extra.TEXT", format);
        startActivity(Intent.createChooser(intent, null));
        return true;
    }
}
